﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using HWmanagementClient.Codes;
using HWmanagementClient.HWManager;

namespace HWmanagementClient.Models
{
    public class MessageClientModel
    {
        public int ID { get; set; }
        public string to { get; set; }
        public string subj { get; set; }
        public string from { get; set; }
        public string message { get; set; }
        public int isread { get; set; }
        public bool isinbox { get; set; }

        public static MessageClientModel fromWCF(MessageModel model)
        {
            return new MessageClientModel()
            {
                from = model.sender,
                to = model.receiver,
                ID = model.id,
                isread = model.is_read ? 1 : 0,
                message = model.messageBody,
                subj = model.subject,
                isinbox =  true
            };
        }
    }

    public class UserMessages
    {
        public Tuple<string, string, string> userData { get; set; }
        public MessageClientModel messagemodel { get; set; }
        public List<MessageClientModel> messages { get; set; } 
    }
}